﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfControlDemo.Models;

namespace WpfControlDemo.ViewModels
{
    public class Window2ViewModel
    {
        /// <summary>
        /// 列表数据项
        /// </summary>
        public List<ClassInfo> ClassList { get; set; }

        /// <summary>
        /// 初始化
        /// </summary>
        public Window2ViewModel() 
        {
            List<ClassInfo> classList = GetClassList(); // 获取数据源
            ClassList= classList;
        }

        /// <summary>
        /// 获取班级信息列表
        /// </summary>
        /// <returns></returns>
        public List<ClassInfo> GetClassList()
        {
            List<ClassInfo> list = new List<ClassInfo>();
            for (int i = 1; i <= 20; i++)
            {
                ClassInfo classInfo = new ClassInfo();
                classInfo.ClassId = i;
                classInfo.ClassName = $"项目名称-{i}";
                list.Add(classInfo);
            }
            return list;
        }
    }
}
